@extends('admin.layout.layout')
@section('title','用户修改')
@section('content')
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <h1 class="page-header">用户修改</h1>
            </div>
            <!-- /.col-lg-12 -->
        
		     <div class="col-lg-8 col-lg-offset-2">
		     		@if (count($errors) > 0)
		    <div class="alert alert-danger">
		        <ul>
		            @foreach ($errors->all() as $error)
		                <li>{{ $error }}</li>
		            @endforeach
		        </ul>
		    </div>
					@endif
			</div>
	        <div class="col-lg-8 col-lg-offset-2">
	            <div class="panel panel-default">
	              	<div class="panel-body">
	                    <div class="row">
	                        <div class="col-lg-12">
	                            <form  method="post" action="{{url('/admin/user/update')}}" enctype="multipart/form-data">
	                                <div class="form-group">
	                                    <label>用户名</label>
	                                    <input class="form-control" value="{{$users->uname}}" name="uname">
	                                </div>
	                            
	                                <div class="form-group">
	                                    <label>邮箱</label>
	                                    <input class="form-control" value="{{$users->email}}" name="email">
	                                </div>
	                                <div class="form-group">
	                                    <label>手机</label>
	                                    <input class="form-control" value="{{$users->tel}}" name="tel">
	                                </div>
	                                <div class="form-group">
                                            <label>性别</label>
                                            <label class="radio-inline">
                                                <input name="sex"  value="m" @if($users->sex == 'm') checked @endif value="0" type="radio">男
                                            </label>
                                            <label class="radio-inline">
                                                <input name="sex"  value="w" @if($users->sex == 'w') checked @endif value="0"  type="radio">女
                                            </label>
                                    </div>
	                                 <div class="form-group">
                                            <label>权限</label>
                                            <select class="form-control" name="auth">
                                                <option @if($users->auth == '0') selected @endif value="0">普通用户</option>
                                                <option @if($users->auth == '1') selected @endif value="1">管理员</option>
                                            </select>
                                     </div>
	                              	 <div class="form-group">
	                                    <label>头像上传</label>
	                                    <input type="file" name="uface">
	                                    <img src="{{$users->uface}}" style="width:80px" alt="">
	                                </div>
	                               	{{ csrf_field() }}
	                               	<input type="hidden" name="uid" value="{{$users->uid}}">
	                               	<button type="submit" class="btn btn-primary">修改</button>
	                                <button type="reset" class="btn btn-danger">重置</button>
									<a class="btn btn-success" href="editpw?id={{$users->uid}}">修改密码</a>
	                            </form>
	                        </div>
	                        <!-- /.col-lg-6 (nested) -->
	     
	                    </div>
	                    <!-- /.row (nested) -->
	                </div>
	                <!-- /.panel-body -->
	            </div>
	            <!-- /.panel -->
	        </div>
	        <!-- /.col-lg-12 -->
	    </div>
		    
		</div>
       </div>
       
        <!-- /.row -->
    </div>
  @endsection